package design.proxy.dynamic;

import java.lang.reflect.Proxy;

/**
 * \* User: Administrator
 * <p>
 * \* Date: 2020/9/21
 * <p>
 * \* Time: 16:55
 * <p>
 * \* Description:
 * \
 */
public class Client {
    public static void main(String[] args) {
        GamePlayer player = new GamePlayer("张三");
        GamePlayIH handler = new GamePlayIH(player);

        IGamePlayer proxy = (IGamePlayer) Proxy.newProxyInstance(player.getClass().getClassLoader(), new Class[]{IGamePlayer.class}, handler);
        proxy.login();
        proxy.play();
    }
}
